[IOEMU] Fix shift key for graphical vnc display
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 23 Jul 2007 09:02:37 +0000 (10:02 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Mon, 23 Jul 2007 09:02:37 +0000 (10:02 +0100)
commitc5b151445d21dcbc0bc80b70e4bdfcde789ee3ca
tree55baca9b186661cac9aa29de0f856b7e4e939d0c
parent9f92ded9df56ef4eabeae6550ae4d1fd8b2937d0
[IOEMU] Fix shift key for graphical vnc display

There is a problem in the input of the key in the VNC connection on
the HVM domain. When client's keyboard is not the same as the kind of
the keyboard of qemu-dm and GuestOS, it is not possible to input it
correctly.

   VNC client     qemu-dm & GuestOS
--------------+-----------------------
    ja             en-us               ==> NG
    en-us          en-us               ==> OK

Originally, the same keysym-code between client and qemu-dm is
transmitted. However, even if it is the same character, the state of
shift is different according to the kind of keyboard.

ex.
   "=" charactor
---------------------
en-us :  "="
ja    :  shift + "-"

Therefore, it is necessary to handle the state of the shift by setting
qemu-dm and GuestOS. There is information on whether shift is
necessary for each key for the keymap of qemu-dm.

ex.
 VNC client        : ja
 qemu-dm & GuestOS : en-us
 input key         : "="
 event client to qemu-dm :
  shift(push) >> "="(push) >> "="(release) >> shift(release)
 event qemu-dm to guest :
  shift(push) >> shift(release) >> "="(push) >> "="(release) >>
 shift(push) >>
shift(release)

This patch handled the state of shift from the set keymap.
When client's keyboard is not same as the kind of qemu-dm/GuestOS,
it is possible to input it correctly.
It was confirmed to input it correctly mutually with this patch
between en-us and ja.

Signed-off-by: Takanori Kasai <kasai.takanori@jp.fujitsu.com>
tools/ioemu/keymaps.c
tools/ioemu/vnc.c